// FrogRenameAppendDialog.h : Declaration of the CFrogRenameAppendDialog

#pragma once

#include "resource.h"       // main symbols
#include <atlhost.h>
#include "FrogProgressReportDialog.h"


// CFrogRenameAppendDialog

class CFrogRenameAppendDialog: public CFrogProgressReportDialog<CFrogRenameAppendDialog>,
	public CWinDataExchange<CFrogRenameAppendDialog>
{
public:
	CFrogRenameAppendDialog(HICON hIcon);

	enum { IDD = IDD_DIALOG_RENAME_APPEND };

	BEGIN_MSG_MAP(CFrogRenameAppendDialog)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_HANDLER(IDOK, BN_CLICKED, OnClickedOK)
		COMMAND_HANDLER(IDC_EDIT_SPOSTFIX, EN_CHANGE, OnEnChangeEditPostfix)
		COMMAND_HANDLER(IDC_EDIT_PREFIX, EN_CHANGE, OnEnChangeEditPrefix)
		// FrogBaseDialog Inherited
		CHAIN_MSG_MAP(CFrogProgressReportDialog)
	END_MSG_MAP()

	BEGIN_DDX_MAP(CFrogRenameAppendDialog)
		DDX_TEXT(IDC_EDIT_SPOSTFIX, m_Postfix)
		DDX_TEXT(IDC_EDIT_PREFIX, m_Prefix)
	END_DDX_MAP()
	// Handler prototypes:
	//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);

	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnEnChangeEditPostfix(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnEnChangeEditPrefix(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	virtual void ExecuteCommand();

	CString m_Postfix;
	CString m_Prefix;

private:
	void SetPostPrePreview(wstring originalName = L"filename.ext");
};


